<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<body>
	<link href="<%=basePath %>css/load.css" rel="stylesheet" />
	<div class="introLoaderWrapper" id="introLoaderWrapper">
		<div class="introLoader">
			<i id="loadingMessage"></i> <span class="text" id="loginText">Loading...</span>
		</div>

		<!--[if lte IE 7]><span class="ltie7Logo" alt="Akrapovič"></span><![endif]-->
		<!--[if lte IE 8]>
            <span class="ieNotice"><p>This website is not optimized for use with Internet Explorer 8 and its earlier versions.<br /><a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie">Update your browser</a> or <a href="http://www.google.com/chrome/">install Google Chrome.</a></p></span>
        <![endif]-->
	</div>


	<div class="login">

		<form action="" id="loginForm">
			<div class="item logo">蚂蚁爱家管理系统</div>
			<div class="item">
				<input id="account" type="text" placeholder="请输入用户名" />
			</div>
			<div class="item">
				<input id="pass" type="password" placeholder="请输入密码" />
			</div>
			<%--     		<div class="item code">
    			<input type="text" placeholder="请输入验证码"/>
    			<img src="<%=basePath %>img/code.jpg" />
    		</div> --%>
			<div class="item">
				<button id="login" type="button"
					class="btn btn-block btn-outline btn-default btn-rounded">登 录</button>
			</div>
			<div class="item warning">
				<p id="message"></p>
			</div>
		</form>

	</div>

	<iframe src="<%=basePath%>View/web/gif" class="gifBg"></iframe>

	<script src="<%=basePath %>js/jquery-2.1.4.min.js"></script>
	<script>
	setTimeout(function(){
		$('.login,.introLoader,.gifBg').fadeToggle(1000);
	},2000)
	 $('#login').click(function(){
                	var account = $('#account').val();
                	var pass = $('#pass').val();
                	$.post(_basePath+"admin/login",{'account':account,'pass':pass},function(data){
                		if (data.code==200){
                			$('.login,.introLoader,.gifBg').fadeToggle(1000);
                			$('#loginText').text('系统登录验证中...')
                			setTimeout(function(){
                				$('#loginText').text(data.message);
                			},6000); 
                			setTimeout(function(){
                				window.location.href='View/web/index';
                			},4000); 
                		}else{
                			$('#message').html(data.message);
                		}
                	})
                })
</script>
</body>
</html>